load("@prelude//toolchains/android/tools:build_rules.bzl", "buck_java_library")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("android_devxx")

source_listing()

PLATFORM_SRCS = [
    "Platform.java",
    "PlatformType.java",
]

buck_java_library(
    name = "platform",
    srcs = PLATFORM_SRCS,
    # This target is pulled in by testrunner, which needs to compile against Java 8.
    # @oss-disable[end= ]: source = "8",
    # @oss-disable[end= ]: target = "8",
    source = "11", # @oss-enable
    target = "11", # @oss-enable
    visibility = [
        "PUBLIC",
    ],
    # This library is deep in the dependency tree, keep its dependency list small.
    deps = [
    ],
)

buck_java_library(
    name = "environment",
    srcs = glob(
        ["*.java"],
        exclude = PLATFORM_SRCS,
    ),
    tests = [
        "prelude//toolchains/android/test/com/facebook/buck/util/environment:environment",
    ],
    visibility = [
        "PUBLIC",
    ],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/core/util/log:log",
        "prelude//toolchains/android/src/com/facebook/buck/util:process_executor",
        "prelude//toolchains/android/src/com/facebook/buck/util:util",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:platform",
        "prelude//toolchains/android/third-party:guava",
        "prelude//toolchains/android/third-party:jackson-annotations",
        "prelude//toolchains/android/third-party:jackson-databind",
        "prelude//toolchains/android/third-party:jsr305",
    ],
)
